var minCostClimbingStairs = function (cost) {
    // 到达第i台阶所花费的最少体力为dp[i]
    // dp[i - 1] 跳到 dp[i] 需要花费 dp[i - 1] + cost[i - 1]
    let dp = []
    dp[0] = 0
    dp[1] = 0
    const len = cost.length;
    for (let i = 2; i <= len; i++) {
        dp[i] = Math.min(dp[i - 1] + cost[i - 1], dp[i - 2] + cost[i - 2])
    }
    return dp[len]
};